home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-01-24 | 4.5 KB | 178 lines | [TEXT/MPS ] |
- ;
- ; File: Serial.a
- ;
- ; Contains: Serial port Interfaces.
- ;
- ; Version: Technology: System 7.5
- ; Package: Universal Interfaces 2.2 in “MPW” on ETO #20
- ;
- ; Copyright: © 1984-1995 by Apple Computer, Inc.
- ; All rights reserved.
- ;
- ; Bugs?: If you find a problem with this file, use the Apple Bug Reporter
- ; stack. Include the file and version information (from above)
- ; in the problem description and send to:
- ; Internet: apple.bugs@applelink.apple.com
- ; AppleLink: APPLE.BUGS
- ;
- ;
-
- IF &TYPE('__SERIAL__') = 'UNDEFINED' THEN
- __SERIAL__ SET 1
-
-
- IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
- include 'Types.a'
- ENDIF
- ; include 'ConditionalMacros.a' ;
-
- baud300 EQU 380
- baud600 EQU 189
- baud1200 EQU 94
- baud1800 EQU 62
- baud2400 EQU 46
- baud3600 EQU 30
- baud4800 EQU 22
- baud7200 EQU 14
- baud9600 EQU 10
- baud19200 EQU 4
- baud38400 EQU 1
- baud57600 EQU 0
- stop10 EQU 16384
- stop15 EQU -32768
- stop20 EQU -16384
- noParity EQU 0
- oddParity EQU 4096
- evenParity EQU 12288
- data5 EQU 0
- data6 EQU 2048
- data7 EQU 1024
- data8 EQU 3072
-
- ctsEvent EQU 32
- breakEvent EQU 128
- xOffWasSent EQU 128
- dtrNegated EQU 64
- ainRefNum EQU -6 ;serial port A input
- aoutRefNum EQU -7 ;serial port A output
- binRefNum EQU -8 ;serial port B input
- boutRefNum EQU -9 ;serial port B output
- swOverrunErr EQU 1 ;serial driver error masks
- breakErr EQU 8 ;serial driver error masks
- parityErr EQU 16 ;serial driver error masks
- hwOverrunErr EQU 32 ;serial driver error masks
- framingErr EQU 64 ;serial driver error masks
- serdOptionClockExternal EQU $40 ;option bit used with Control code 16
- serdOptionPreserveDTR EQU $80 ;option bit used with Control code 16
-
- sPortA EQU 0
- sPortB EQU 1
-
- ; typedef SInt8 SPortSel
- ; csCodes for serial driver Control routines
-
- serdReset EQU 8
- serdSetBuf EQU 9
- serdHShake EQU 10
- serdClrBrk EQU 11
- serdSetBrk EQU 12
- serdSetBaud EQU 13
- serdHShakeDTR EQU 14
- serdSetMIDI EQU 15
- serdSetMisc EQU 16
- serdSetDTR EQU 17
- serdClrDTR EQU 18
- serdSetPEChar EQU 19
- serdSetPECharAlternate EQU 20
- serdSetXOff EQU 21
- serdClrXOff EQU 22
- serdSendXOnConditional EQU 23
- serdSendXOn EQU 24
- serdSendXOffConditional EQU 25
- serdSendXOff EQU 26
- serdChannelReset EQU 27
- serdSet230KBaud EQU 'JF' ; set 230K baud data rate
- serdSetPollWrite EQU 'jf' ; disable interrupt-driven transmit
- serdSetFlushCount EQU 'FC'
-
- ; csCodes for serial driver Status routines
- serdGetBuf EQU 2
- serdStatus EQU 8
- serdGetVers EQU 9
- serdGetVersSys EQU $8000
-
- SerShk RECORD 0
- fXOn ds.b 1 ; offset: $0 (0) ;XOn flow control enabled flag
- fCTS ds.b 1 ; offset: $1 (1) ;CTS flow control enabled flag
- xOn ds.b 1 ; offset: $2 (2) ;XOn character
- xOff ds.b 1 ; offset: $3 (3) ;XOff character
- errs ds.b 1 ; offset: $4 (4) ;errors mask bits
- evts ds.b 1 ; offset: $5 (5) ;event enable mask bits
- fInX ds.b 1 ; offset: $6 (6) ;Input flow control enabled flag
- fDTR ds.b 1 ; offset: $7 (7) ;DTR input flow control flag
- sizeof EQU * ; size: $8 (8)
- ENDR
-
- ; typedef struct SerShk SerShk
- SerStaRec RECORD 0
- cumErrs ds.b 1 ; offset: $0 (0)
- xOffSent ds.b 1 ; offset: $1 (1)
- rdPend ds.b 1 ; offset: $2 (2)
- wrPend ds.b 1 ; offset: $3 (3)
- ctsHold ds.b 1 ; offset: $4 (4)
- xOffHold ds.b 1 ; offset: $5 (5)
- sizeof EQU * ; size: $6 (6)
- ENDR
-
- ; typedef struct SerStaRec SerStaRec
- ;
- ; pascal OSErr SerReset(short refNum, short serConfig)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION SerReset
- ENDIF
-
- ;
- ; pascal OSErr SerSetBuf(short refNum, Ptr serBPtr, short serBLen)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION SerSetBuf
- ENDIF
-
- ;
- ; pascal OSErr SerHShake(short refNum, const SerShk *flags)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION SerHShake
- ENDIF
-
- ;
- ; pascal OSErr SerSetBrk(short refNum)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION SerSetBrk
- ENDIF
-
- ;
- ; pascal OSErr SerClrBrk(short refNum)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION SerClrBrk
- ENDIF
-
- ;
- ; pascal OSErr SerGetBuf(short refNum, long *count)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION SerGetBuf
- ENDIF
-
- ;
- ; pascal OSErr SerStatus(short refNum, SerStaRec *serSta)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION SerStatus
- ENDIF
-
- ENDIF ; __SERIAL__
-